package tv.dyndns.kishibe.server;

import com.google.gwt.logging.server.RemoteLoggingServiceImpl;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
import com.google.inject.servlet.ServletModule;

public class QMACloneGuiceServletConfig extends GuiceServletContextListener {
	@Override
	protected Injector getInjector() {
		return Guice.createInjector(new ServletModule() {
			@Override
			protected void configureServlets() {
				super.configureServlets();
				serve("/tv.dyndns.kishibe.QMAClone/service").with(ServiceImpl.class);
				serve("/icon").with(ServiceIconUpload.class);
				serve("/rss.xml").with(ServiceRss.class);
				serve("/image/*").with(ServiceImageProxy.class);
				serve("/tv.dyndns.kishibe.QMAClone/remote_logging").with(
						RemoteLoggingServiceImpl.class);
				serve("/openid_response").with(OpenIdResponseServlet.class);
			}
		}, new QMACloneModule());
	}
}
